/**
 * SPDX-FileCopyrightText: 2023-2025 Sangfor Technologies Inc.
 * SPDX-License-Identifier: Mulan PSL v2
 */
<template>
    <div class="release-form__container">
        <sf-form ref="form"
                 :label-width="100">
            <div class="title">
                <lang>请选择正式发布的服务：</lang>
            </div>
            <div v-for="(item,index) in list" 
                 :key="index"
                 class="radio__item" 
                 :class="{'active':activeIndex===index}" 
                 @click="_selectRadio(index)">
                <div class="radio__circle"
                     :class="{'active':activeIndex===index}"></div>
                <div class="radio__name">
                    {{ item.name }}
                </div>
            </div>
        </sf-form>
    </div>
</template>
<script>
    

const DEFAULT_VALUE = {
    time_select:true
};
export default {
    name: 'ReleaseForm',
        
    data () {
        return {
            submitData: { ...DEFAULT_VALUE },
            activeIndex:0,
            list:[]
        };
    },
    
    mounted () {
           
    },
    methods: {
        _selectRadio (index) {
            this.activeIndex = index;
        },
        getJsonValue () {
            return this.activeIndex;
        }
     
    }
};
</script>
<style lang="less">
    .release-form__container{
        margin-bottom: 166px;
        .title{
            margin-bottom: 30px;
            color: #14161A;
        }
        .radio__item{
            margin-top: 20px;
            width: 576px;
            height: 64px;
            background:url(../../../../img/release_normal.png) no-repeat;
            background-size:100% 100%;
            margin-bottom:16px;
            display: flex;
            align-items:center;
            font-size: 14px;
            color: #5C5C5C;
            cursor: pointer;
            &.active{
                background:url(../../../../img/release_active.png) no-repeat;
                background-size:100% 100%;
                font-size: 14px;
                color: #14161A;
                font-weight: bold;
            }
            .radio__circle{
                width: 16px;
                height: 16px;
                border-radius: 100%;
                position: relative;
                margin-left: 17px;
                margin-right: 9px;
                &::after, &::before {
                    content: "";
                    position: absolute;
                    display: block;
                    top: 0;
                    left: 0;
                    border-radius: 50% 50%;
                    cursor: pointer;
                }
                &.active{
                    &::before{
                        background-color: #204ed9;
                        border-color: #204ed9;
                    }
                    &::after {
                        background-color: #fff;
                    }
                }
                &::before{
                    z-index: 0;
                    border: 1px solid #c2c2c2;
                    width: 14px;
                    height: 14px;
                    background-color: #fff;
                    transition: all .3s;
                }
                &::after {
                    z-index: 1;
                    width: 6px;
                    height: 6px;
                    margin: 4px;
                    background-color: transparent;
                }
            }
        } 
    }
</style>   
    
        